package cn.sharp.bbs.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

public interface InteractDao {
    @Select("select count(0) from t_like where post_id=#{postId} and user_id=#{u_id}")
    int checkIsLike(Long postId, Long u_id);

    @Delete("delete from t_like where post_id=#{postId} and user_id=#{u_id}")
    void cancelLike(Long postId, Long u_id);

    @Select("select count(0) from t_collect_post where post_id=#{postId} and user_id=#{u_id}")
    int checkIsCollect(Long postId, Long u_id);

    @Delete("delete from t_collect_post where post_id=#{postId} and user_id=#{u_id}")
    void cancelCollect(Long postId, Long u_id);

    @Select("select count(0) from t_follow_post where post_id=#{postId} and user_id=#{u_id}")
    int checkIsFollow(Long postId, Long u_id);

    @Delete("delete from t_follow_post where post_id=#{postId} and user_id=#{u_id}")
    void cancelFollow(Long postId, Long u_id);
}
